<template>
  <div class="p-30">
    <!-- 已处理的审核列表 -->
    <el-table :data="list">
      <el-table-column
          width="80"
      >
        <template v-slot="{row}">
          {{ row.stu_code.slice(0, 4) }}级
        </template>
      </el-table-column>
      <el-table-column
          label="申请人"
          prop="name"
          width="80"
      >
      </el-table-column>
      <el-table-column
          label="申请理由"
          prop="content"
      >
      </el-table-column>
      <el-table-column
          label="申请日期"
          width="180"
      >
        <template v-slot="{row}">
          {{ $dayjs(row.apply_time * 1).format('YYYY-MM-DD') }}
        </template>
      </el-table-column>
      <el-table-column
          label="状态"
      >
        <template v-slot="{row}">
          <div>
            {{row.done === 1?'同意':row.done === 2? '拒绝':'已加入其他社团'}}
          </div>
        </template>
      </el-table-column>
    </el-table>
    <!-- 已处理的审核列表 end -->

    <!-- 分页器 -->
    <el-pagination
        background
        layout="prev, pager, next"
        :total="total"
        v-show="total>limit"
        :page-size="limit"
        :current-page.sync="pageNo"
        class="pt-30 text-center"
    ></el-pagination>
    <!-- 分页器 end-->
  </div>
</template>

<script>
import {getUserApplyProcessed} from "@/api/apply";

export default {
  name: "AuditList",
  data() {
    return {
      pageNo: 1,
      limit: 10,
      total:0,
      list: []
    }
  },
  mounted() {
    this.getUserApplyProcessedList();
  },
  methods:{
    async getUserApplyProcessedList(){
      let result = await getUserApplyProcessed({
        society_id: this.$store.getters.society_id,
        pageNo: this.pageNo,
        limit: this.limit,
      });
      if (result.code === 200) {
        this.list = result.list
        this.total = result.total
      }
    }
  },
  watch:{
    pageNo(){
      this.getUserApplyProcessedList();
    }
  }
}
</script>

<style scoped>

</style>